#ifndef WORLD_H
#define WORLD_H

#include "SDL2/SDL.h"

/* special keyes */
#define DD_KEY_STATE_PRESSED  1
#define DD_KEY_STATE_RELEASED 0

void (*dd_world_update)(void*);
void (*dd_world_draw)(void*);

void (*dd_world_key)(void*, SDL_Scancode, int);
void (*dd_world_mouse)(void*, int, int, int, int);

void (*dd_world_click)(void*, int, int);

struct dd_world {
	void (*update)(void*);
	void (*draw)(void*);
	void (*key)(void*, SDL_Scancode, int);
	void (*mouse)(void*, int, int, int, int);
	void (*click)(void*, int, int);
	int next;
};

/* This is a pointer to the current world. */
struct dd_world *dd_cworld;

/* helper functions to create and initialise a world */
struct dd_world *dd_world_create();
void dd_world_init(struct dd_world *w);

/* empty default functions */
void dd_world_emptyupdate(void *);
void dd_world_emptydraw(void *);
void dd_world_emptykey(void *, SDL_Scancode, int);
void dd_world_emptymouse(void *, int, int, int, int);
void dd_world_emptyclick(void *, int, int);

#endif
